Now let's talk
about availability. This is important
today more than ever. If your business critical
applications are unavailable, your business is down. This costs money, hurt
your reputation and your customers may not be
tolerant of the inconvenience. Two decades ago, planned maintenance downtime was
a standard practice. I can still remember that banking websites
used to close for business during the night to
perform batch processing. Today, applications are
expected to be always on. People use online applications
for critical processes, like in health
care and aviation. Only the highest
availability and lowest end user latency are acceptable for
these applications. In the next three slides, I want to highlight three
features on Cloud Run that help you design highly
available applications. Number 1, auto
scaling the number of containers to handle
all incoming requests. Number 2, incremental
application updates, switching traffic gradually
with easy rollback. Finally number 3, load balancing across
zones and regions. Cloud Run automatically
increases capacity when necessary to make sure it
handles all incoming requests. This feature is known
as auto scaling, and this is how it works. Every service has an
internal load balancer. The load balancer
distributes requests over the group of
available containers. If all containers are busy, Cloud Run adds
additional containers. As soon as the demand
decreases once more, Cloud Run stop sending traffic to these containers
and shuts them down. The maximum number
of containers in a single Cloud Run service is 1,000 and you can increase this limit if you send the
request to Google support. If a container breaks, Cloud Run will remove it. A common cause of
service disruption are often application updates. These events of course, affect the availability
of your application. Cloud Run supports immutable
deployment out of the box. If you make a change
to your application, Cloud Run creates
a new revision. A revision is an
immutable copy of your container and the
service configuration. You can shift the traffic to the new revision
gradually to reduce the impact of a
failure and maintain application availability
during the update. It is not required to take an incremental approach
to deployment. You can also choose
to send a 100 percent of your traffic to the
new revision immediately. Cloud Run is a regional service. This is important
because it affects the reliability of Cloud Run. A region is a Google
Cloud data-center. For example, US center 1
is Iowa, North America. Every region has
three or more zones. Zones are designed to be a single point of
failure inside a region. This means it is unlikely that a single zone will
go down and it is incredibly unlikely that all three zones go
down at the same time. Cloud Run distribute
your containers across multiple zones in one region to make sure it is resilient against the
failure of a zone. You can take this same
principle and apply it to running a global service. Cloud Run integrates with
the global load balancer, which allows you to expose a single global IP address in front of multiple regional
Cloud Run services. The global load balancer
makes sure the traffic from a client always goes to the
region closest to them. Aside from improving
availability the global load balancer decreases latency for
clients worldwide. This is why that's important. Just a decade ago, loading a webpage might have
taken more than a second. Today, the expectation is that the loading operation
completes in milliseconds. If it takes too long to
load your application, user might think
your application is down and abandon the request.